function ngrams = word_ngram(word_list,n,isReview)

ngrams={};
whitespace= 32; %ASCII 


if(isReview==1) %for review array
     
    for i=1:(size(word_list,2))
       wordN= size(word_list{i},2);
       for j=1:(wordN-(n-1))
           
           
             str='';
    
            for z=1:n
                str= strcat(str,whitespace,word_list{i}{(j-1)+z});
            end

            ngrams{i}{j}=strtrim(str);
      
            
        
      end
    end

else
    
 for i=1:(size(word_list,2)-(n-1))

          str='';
      
           for z=1:n
               str= strcat(str,whitespace,word_list{(i-1)+z});
           end

            ngrams{i}=strtrim(str);
  

 end
    
end % end of if